$(function () {
	$(".form-horizontal").validate({
		errorElement : "label",  
        errorClass : "text-danger",  
        rules : {  
        	account : {  
            	required : true,
            	minlength: 5,
            	maxlength: 30
            },  
            name: {
            	required: true,
            	minlength: 2,
            	maxlength: 10
            },
            "type.value": {
            	required: true
            },
            tel: {
            	minlength:11,
            	maxlength:20
            },
            email: {
            	email:true,
            	minlength:5,
            	maxlength:50
            },
            remarks: {
            	maxlength:500
            }
        },
        messages: {
        	account: {
        		required: "账号不能为空",
        		minlength: "账号长度不能小于5个字符",
        		maxlength: "账号长度不能超过30个字符"
        	},
        	name: {
        		required : "名称不能为空",
        		minlength: "名称不能少于2个汉字",
            	maxlength: "名称不能超过10个汉字"
        	},
        	"type.value": {
        		required: "类型不能为空"
        	},
        	tel: {
            	minlength:"联系电话的长度不能少于11",
            	maxlength:"联系电话的长度不能超过20"
            },
        	email: {
        		email: "请填写正确的邮箱格式",
        		minlength: "电子邮箱的长度不能少于5",
            	maxlength: "电子邮箱的长度不能超过50"
        	},
            remarks: {
            	maxlength: "备注长度不能超过500"
            }
        }
	});
	
});